<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>组件</title>
		<script src="lib/vue.js"></script>
	</head>
	<body>
		<div id="example-1">
			<simple-counter></simple-counter>
			<simple-counter></simple-counter>
			<simple-counter></simple-counter>
		</div>
	</body>
	<script type="text/javascript">
	   // var counter={counter:0}
	    
//		Vue.component('simple-counter',{
//			template:'<button v-on:click="counter += 1">{{counter}}</button>',
//			data:function(){
//				return counter
//			}
//		});
		Vue.component('simple-counter',{
			template:'<button v-on:click="counter += 1">{{counter}}</button>',
			data:function(){
				return {
					counter:0
				}
			}
		});
		new Vue({
			el:'#example-1'
		});
	</script>
</html>
